import List from "./List"


function App() {

  const fruits = [{id: 1, name: "apple", calories: 95}, 
                  {id: 2, name: "banana", calories: 110},
                  {id: 3, name: "orange", calories: 60},
                  {id: 4, name: "mango", calories: 85}, 
                  {id: 5, name: "grape", calories: 180}]
  const vegetables = [{id: 6, name: "potos", calories: 120}, 
                  {id: 7, name: "celery", calories: 15},
                  {id: 8, name: "carrots", calories: 24},
                  {id: 9, name: "corn", calories: 66}, 
                  {id: 10, name: "broccoli", calories: 20}]

  return (
    <>
      {fruits.length > 0 ? <List items={fruits}  categroy="Fruits"/> : null}
      {vegetables.length > 0 && <List items={vegetables} categroy="Vegetables"/> }
    </>
  )
}

export default App
